package yzserver.sx4a.dao.ibatis;

import com.sitech.ibnms.core.BaseIbnmsDao;
import yzserver.sx4a.dao.IOrgDao;
import yzserver.sx4a.domain.OrganizationDomain;

import java.util.HashMap;
import java.util.List;

public class OrgDaoImpl extends BaseIbnmsDao implements IOrgDao {

    @Override
    public OrganizationDomain selOrg(String orgid) {
        HashMap map = new HashMap();
        map.put("orgid",orgid);
        return (OrganizationDomain)querySingle("shanxi_selOrg",map);
    }

    @Override
    public void addOrg(OrganizationDomain org) throws Exception {
        insert("shanxi_addOrg",org);
    }

    @Override
    public void updOrg(OrganizationDomain org) throws Exception {
        update("shanxi_updOrg",org);
    }

    @Override
    public void delOrg(String orgid) throws Exception {
        HashMap map = new HashMap();
        map.put("orgid",orgid);
        delete("shanxi_delOrg",map);
    }

    @Override
    public List<OrganizationDomain> selAllOrg(String orgid){
        HashMap map = new HashMap();
        map.put("orgid",orgid);
        return (List<OrganizationDomain>)query("shanxi_selAllOrg", map);
    }
}
